<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .grid{
            display: grid;
            
            grid-template-rows: 1fr 1fr ;
            grid-template-columns: 1fr 1fr ;
            row-gap: 3px;
            column-gap: 2px;

            height: 400px;
            width: 400px;
            margin: auto;
            border-style: solid;
            border-width: 2px;
        }

        .grid>div{
            background-color: rebeccapurple;
        }
        
    </style>
</head>

<body>
    <div class="grid">
        <div id="div1">div1</div>
        <div id="div2">div2</div>
        <div id="div3">div3</div>
        <div id="div3">div4</div>
    </div>

</body>

</html>